package cn.edu.stu.syllabus.utils;

import android.support.annotation.ColorRes;
import android.support.v4.content.ContextCompat;
import android.widget.ProgressBar;

import cn.edu.stu.syllabus.application.SyllabusApplication;

/**
 * Created by daidaijie on 2017/3/31.
 * ProgressBar着色工具类
 */

public class ProgressBarColorTintUtils {

    public static void setColor(ProgressBar progressBar, @ColorRes int color) {
        progressBar.getIndeterminateDrawable().setColorFilter(
                ContextCompat.getColor(SyllabusApplication.getContext(), color),
                android.graphics.PorterDuff.Mode.SRC_IN);
    }
}
